﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace Project.module
{
    public partial class frmThemkv : Form
    {
        public frmThemkv()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            KhuVucDTO kv = new KhuVucDTO();
            try
            {
                kv.Tenkv = txtTen.Text;
                kv.MaxBan = int.Parse(txtSoluong.Text);
                bool kt = KhuVucBUS.Themkv(kv);
                if (kt)
                    this.Close();
            }
            catch
            {
                MessageBox.Show("Dữ liệu nhập không chính xác !");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
